using System;
using System.Windows.Forms;
using Curriculum.UI.Clases;

namespace Curriculum.UI.Helper
{
	/// <summary>
	/// Esta clase se utiliza para crear controles
	/// de acuerdo a un tipo
	/// </summary>
	public class ControlFactoryHelper
	{
		public static Control GetControl(string type)
		{
			Control control = null;
			switch(type)
			{
				case "TXT": //Text Box
						control = new TextBox();
					break;
				case "CBX": // Combo Box
						control = new ComboBox();
					break;
				case "DTP": // Date Time Picker
						control = new DateTimePickerNullable();
					break;
				case "TXA": // Text Box con multiline
						control = new TextBox();
					    ((TextBox)control).Multiline = true;
					break;
				case "CBM": // ComboMeses
						control = new ComboBox();
					break;
				case "CBA": // ComboAnios
						control = new ComboBox();
					break;
				default:
						control = new TextBox();
					break;
			}
			return control;
		}

	}
}
